﻿using KinonekoSoftware.Foundation.Styles;
using KinonekoSoftware.Platform.Core;
using KinonekoSoftware.Platform.Views;
using KinonekoSoftware.UI;

namespace KinonekoSoftware.Platform
{
    partial class NativeApplication
    {
        internal virtual void InstallViewAndViewModelsInternal()
        {
            //
            // 安装框架提供的视图
            Xplat.InstallView<InternalErrorDialogView, InternalErrorDialogVM>();
            Xplat.InstallView<InternalErrorView, InternalErrorPageVM>();
            Xplat.InstallView<SingleLineView, SingleLineViewModel>();
            Xplat.InstallView<MultiLineView, MultiLineViewModel>();
            Xplat.InstallView<TripleSelectionView, TripleSelectionViewModel>();
            Xplat.InstallView<DangerOperationView, DangerOperationViewModel>();
            Xplat.InstallView<DangerNotificationView, DangerNotificationViewModel>();
            Xplat.InstallView<WarningOperationView, WarningOperationViewModel>();
            Xplat.InstallView<WarningNotificationView, WarningNotificationViewModel>();
            Xplat.InstallView<SuccessOperationView, SuccessOperationViewModel>();
            Xplat.InstallView<SuccessNotificationView, SuccessNotificationViewModel>();
            Xplat.InstallView<InfoOperationView, InfoOperationViewModel>();
            Xplat.InstallView<InfoNotificationView, InfoNotificationViewModel>();
            Xplat.InstallView<ObsoletedOperationView, ObsoletedOperationViewModel>();
            Xplat.InstallView<ObsoletedNotificationView, ObsoletedNotificationViewModel>();
            
            //
            // 安装开发者自定义的视图
            InstallViewAndViewModels();
        }

        
        protected virtual void InstallViewAndViewModels()
        {
            //
            // 安装视图模型关联注册器
            Xplat.InstallFromRegisters();
        }
        
        
        protected virtual ThemeSystem InstallTheming(ForestSetting setting)
        {
            return new DarkThemeSystem();
        }
    }
}